import Vue from 'vue';
import VueResource from 'vue-resource';
import router from './router/router';
import App from './App';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import htmlToPdf from '@/utils/htmlToPdf';
Vue.use(htmlToPdf);    

import VueQuillEditor from 'vue-quill-editor';
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor);

import VideoPlayer from 'vue-video-player';
Vue.use(VideoPlayer)

Vue.use(ElementUI)

Vue.use(VueResource);

Vue.filter('deviceStatus', val => {
  if (val == 1) {
    return '启用'
  } else {
    return '禁用'
  }
})

Vue.mixin({
  methods:{
    isShow(id){
      // return true;
      let btnList=window.localStorage.getItem("btnList");
      let btnListJson=JSON.parse(btnList);
      for(let i in btnListJson){
        if(id==btnListJson[i]){
          return true;
        }
      }
      return false;
    }
  }
})

new Vue({
  el: '#app',
	router,
  template: '<App/>',
  components: { App },
  beforeCreate:function(){
    console.log('beforeCreated.....');
  }
});

